package com.kds.smarthome.service.impl;

import com.kds.smarthome.entity.SysOperLog;
import com.kds.smarthome.mapper.SysOperLogMapper;
import com.kds.smarthome.service.SysOperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 操作日志服务实现
 */
@Service
public class SysOperLogServiceImpl implements SysOperLogService {

    @Autowired
    private SysOperLogMapper operLogMapper;

    /**
     * 新增操作日志
     * 
     * @param operLog 操作日志对象
     */
    @Override
    public void insertOperLog(SysOperLog operLog) {
        operLogMapper.insertOperLog(operLog);
    }

    /**
     * 查询系统操作日志集合
     * 
     * @param params 查询参数
     * @return 操作日志集合
     */
    @Override
    public List<SysOperLog> selectOperLogList(Map<String, Object> params) {
        return operLogMapper.selectOperLogList(params);
    }

    /**
     * 查询总记录数
     * 
     * @param params 查询参数
     * @return 总记录数
     */
    @Override
    public long count(Map<String, Object> params) {
        return operLogMapper.count(params);
    }

    /**
     * 批量删除系统操作日志
     * 
     * @param operIds 需要删除的操作日志ID
     * @return 结果
     */
    @Override
    public int deleteOperLogByIds(Long[] operIds) {
        return operLogMapper.deleteOperLogByIds(operIds);
    }

    /**
     * 清空操作日志
     */
    @Override
    public void cleanOperLog() {
        operLogMapper.cleanOperLog();
    }
} 